<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>做最美的自己</title>
	<link rel="stylesheet" type="text/css" href="/static/styles/base.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="/static/styles/form.css" media="screen" />
	<script language="javascript" type="text/javascript" src="/static/javascript/jquery/jquery-1.7.2.min.js"></script>
	<script src="/static/javascript/jquery/jquery.validate.js" type="text/javascript"></script>
	<script src="/static/javascript/jquery/jquery.metadata.js" type="text/javascript"></script>
	<script type="text/javascript">
	var CreateCode = function(){  
		document.getElementById('img_checkcode').src = '/inc/createcode.php?'+Math.random()*10000; 
	};
	
	$().ready(function() {
		//表单验证
		validateflag = $('#RegForm').validate({
			ignore: ".ignore",
			errorElement: "span",
			submitHandler: function (form) {
				form.submit();
			},
			focusInvalid: true,
			onkeyup: false,
			errorPlacement: function (error, element) {
				error.appendTo(element.parent());
			},
			rules:
			{
				email:{
					required:true,
					email:true,
					remote:{
						url: '/index.php/unique/email',    //后台处理程序
						type: "post",              //数据发送方式
						dataType: "json",          //接受数据格式   
						data: {                    //要传递的数据
							email: function() {
								return $("#email").val();
							}
						}
					}
				},
				name:{
					required:true,
					rangelength:[2,12],
					remote:{
						url: '/index.php/unique/name',    //后台处理程序
						type: "post",              //数据发送方式
						dataType: "json",          //接受数据格式   
						data: {                    //要传递的数据
							name: function() {
								return $("#name").val();
							}
						}
					}
				},
				checkcode:{
					required:true,
					remote:
					{
						url: '/inc/verifycode.php',    //后台处理程序
						type: "post",              //数据发送方式
						dataType: "json",          //接受数据格式   
						data: {                    //要传递的数据
							verifycode: function() {
								return $("#checkcode").val();
							}
						}
					}
				}
			},
			messages:
			{
				email:{
					required:'请输入电子邮箱',
					email:'请输入正确的邮箱地址',
					remote:'该邮箱已经被使用'
				},
				name:{
					required:'请输入昵称',
					rangelength:'昵称长度在2-12字符，汉字算一个字符',
					remote:'该昵称已经被使用'
				},
				checkcode:{
					required:'请输入验证码',
					remote:'验证码错误'
				}
			}
		});
	});
	
	var validatefunc = function () {
		if (validateflag.form()) {
			return true;
		}
		else {
			return false;
		}
	};
	</script>
	
</head>
<body >


<div class="reg_wrap">
<div class="fm960">
<div class="logo">
				
</div>
<div class="content">
	<div id="register_box">
		<div id="register_left">
			<h1>新用户注册</h1>    
			<div id="register_center">
				<div id="register_form">
					<?php echo form_open('reg',"id=RegForm"); ?>
					<table id="register_table">
						<tr>
						<th>电子邮箱：</th>
						<td><input maxlength="36" name="email" id="email" class="text r3" value="<?php echo set_value('email'); ?>" type="text"><?php echo form_error('email', '<span class="error">', '</span>'); ?></td>
						</tr>
						<tr>
						<th>昵称：</th>
						<td><input style="" maxlength="36" name="name" id="name" class="text r3" value="<?php echo set_value('name'); ?>" type="text"><?php echo form_error('name', '<span class="error">', '</span>'); ?></td>
						</tr>
						<tr>
						<th>性别：</th>
						<td><input name="sex" value="girl" checked="checked" class="ck" type="radio">女<input style="margin-left: 10px;" name="sex" value="boy" class="ck" type="radio">男</td>
						</tr>
						<tr>
						<th>密码：</th>
						<td><input style="" maxlength="36" name="password" id="password" class="text r3" value="" type="password"><?php echo form_error('password', '<span class="error">', '</span>'); ?></td>
						</tr>
						<tr>
						<th>确认密码：</th>
						<td><input maxlength="36" name="passconf" id="passconf" class="text r3" value="" type="password"><?php echo form_error('passconf', '<span class="error">', '</span>'); ?></td>
						</tr>
						<tr>
						<th>验证码：</th>
						<td colspan=2><input name="checkcode" id="checkcode" maxlength="10" class="check r3 text" value="" type="text"><img src="/inc/createcode.php" id="img_checkcode" alt="验证码" onclick="CreateCode();" /><a href="javascript:void(0);" onclick="CreateCode();">换一张</a><?php echo form_error('checkcode', '<span class="error">', '</span>'); ?></td>
						</tr>
						<tr><td colspan=2 class="pl100"><input class="box " checked="checked" type="checkbox"><span class="gray">我已看过并同意《<a href="http://www.mogujie.com/user/agreement" class="gray" target="_blank">蘑菇街网络服务使用协议</a>》</span></td></tr>
						<tr><td colspan=2 class="pl100"><input class="sub" onclick="return validatefunc();" value="马上注册" type="submit"></td></tr>
					</table>
					</form>
				</div>
			</div>
		</div>
		<!--right start-->
		<div id="register_right">
			<div class="rst_login">
				<span>已经有帐号？请直接登录</span>
				<a href="http://www.mogujie.com/login"></a>
			</div>
			<div class="other_login">
				<span>您也可以用以下方式登录：</span>
				<a class="o_icon" href="http://www.mogujie.com/users/signsina">新浪微博</a>
				<a class="o_icon" href="http://www.mogujie.com/user/signqq" style="background: url(&quot;/static/img/icon_qq_qq.png&quot;) no-repeat scroll left center transparent;">QQ 帐号</a>
				<a class="o_icon" href="http://www.mogujie.com/user/signtaobao" style="background: url(&quot;/static/img/tao.png&quot;) no-repeat scroll left center transparent;">淘宝帐号</a>
				<a class="o_icon" href="http://www.mogujie.com/tencent/login" style="background: url(&quot;/static/img/icon_qq.png&quot;) no-repeat scroll left center transparent;">腾讯微博</a>
				<a class="o_icon" href="http://www.mogujie.com/user/signdouban" style="background: url(&quot;/static/img/icon_douban.png&quot;) no-repeat scroll left center transparent;">豆瓣帐号</a>
				<a class="o_icon" href="http://www.mogujie.com/wangyi/login" style="background: url(&quot;/static/img/icon_wangyi.png&quot;) no-repeat scroll left center transparent;">网易微博</a>
				<a class="o_icon" href="http://www.mogujie.com/user/signrenren" style="background: url(&quot;/static/img/icon_ren.png&quot;) no-repeat scroll left center transparent;">人人网</a>
				<a class="o_icon" href="http://www.mogujie.com/user/signmsn" style="background: url(&quot;/static/img/icon_msn.png&quot;) no-repeat scroll left center transparent;">MSN</a>
			</div>
		</div>
		<!--reight end-->
	</div>
	<div class="clear"></div>
</div>
<p class="copyright" title="SERVER: dugu">?Copyright 2010-2011 </p>
</div>
</div>



</body>
</html>
